package com.huluobo.a2308douyindemo.adapter

import android.view.View
import android.widget.ImageView
import android.widget.TextView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.huluobo.a2308douyindemo.R
import com.huluobo.a2308douyindemo.bean.GoodsCommentBean
import com.huluobo.a2308douyindemo.utils.ImageUtils
import org.w3c.dom.Text

/**
 *  Created by LC on 2025/11/5.
 */
class GoodsCommentAdapter : BaseQuickAdapter<GoodsCommentBean, BaseViewHolder>(R.layout.item_comment) {
    override fun convert(holder: BaseViewHolder, item: GoodsCommentBean) {
        if (item.icon != null) {
            ImageUtils.loadCircleImage(context, item.icon, holder.getView(R.id.item_comment_icon_iv))
        }
        holder.setText(R.id.item_comment_name_tv, item.username)
        holder.setText(R.id.item_comment_content_tv, item.msg)
        holder.setText(R.id.item_comment_time, item.createtime)
        holder.getView<TextView>(R.id.item_reply_tv).visibility = View.GONE
        holder.getView<ImageView>(R.id.item_comment_like_iv).visibility = View.GONE
    }
}